package pers.xuyong.strive.datastruct.mode.single;

/**
 * 饿汉式单例,线程安全
 *
 * @author billymac
 * @version 1.0
 * @date 17/6/23  下午11:24
 * @since JDK1.8
 */
public class HungryModeSingleton {

    private static HungryModeSingleton hungryModeSingleton = new HungryModeSingleton();

    private HungryModeSingleton() {}

    public static HungryModeSingleton getHungryModeSingleton() {
        return HungryModeSingleton.hungryModeSingleton;
    }


    public void display() {
        System.out.println(HungryModeSingleton.class.getName() + " is Hungry Mode!");
    }
}
